#!/usr/local/bin/python3.7
import sys
from audiosplit import splitwav
from asr import asrwavs
import os

if __name__ == '__main__':
	#print(sys.argv)
	names = splitwav(sys.argv[1])
	if len(names)==0:
		print('wave file split fail.')
		os.exit(0)
	res = asrwavs(names)
	print( res )
	#清理临时文件和文件夹
	for i in range(len(names)):
		os.unlink(names[i])
	os.rmdir( os.path.dirname(names[0]) )
	
